package imper.engine.view;

import imper.graphic.ImageManager;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import TWLSlick.BasicTWLGameState;

public abstract class BasicView extends BasicTWLGameState
{
	protected int _id;

	protected ImageManager _manager;

	protected IModelView _model;

	public BasicView(int pId, ImageManager pManager, IModelView pModel)
	{
		_id = pId;
		_manager = pManager;
		_model = pModel;
	}

	@Override
	public abstract void init(GameContainer arg0, StateBasedGame arg1) throws SlickException;

	@Override
	public abstract void render(GameContainer arg0, StateBasedGame arg1, Graphics arg2) throws SlickException;

	@Override
	public abstract void update(GameContainer arg0, StateBasedGame arg1, int arg2) throws SlickException;

	@Override
	public int getID()
	{
		return _id;
	}

	protected ImageManager getManager()
	{
		return _manager;
	}

	protected Image getImage(ImageTypeEnum pType, int pIdImg)
	{
		return _manager.getImage(pType.getId(), pIdImg);
	}
	
	protected IModelView getModel()
	{
		return _model;
	}

}
